#pragma once
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <stdbool.h>

typedef int HeapDataType;

typedef struct heap
{
	HeapDataType* a;
	int Capacity;
	int Size;
}heap;

void HeapInit(heap* php);

void HeapPush(heap* php, HeapDataType x);

void HeapDestroy(heap* php);

void AdjustUp(HeapDataType* a, int child);

void AdjustDown(HeapDataType* a,int n, int parent);

HeapDataType HeapTop(heap* php);

void HeapPop(heap* php,int size);

bool HeapEmpty(heap* php);

int HeapSize(heap* php);

void Swap(HeapDataType* p1, HeapDataType* p2);